package com.level2app.view.dialog;

import android.content.Context;
import android.view.LayoutInflater;

import com.google.android.material.bottomsheet.BottomSheetDialog;
import com.level2app.databinding.DialogMyBottomSheetBinding;

public abstract class MyBottomSheetDialog {

    private final BottomSheetDialog dialog;

    public MyBottomSheetDialog(Context context) {
        dialog = new BottomSheetDialog(context);
        DialogMyBottomSheetBinding binding = DialogMyBottomSheetBinding.inflate(LayoutInflater.from(context));
        dialog.setContentView(binding.getRoot());
        dialog.setCanceledOnTouchOutside(false);
//        binding.brandTv.setOnClickListener(view1 -> {
//
//        });
//
//        binding.memberTv.setOnClickListener(view1 -> {
//
//        });
//
//        binding.confirmTv.setOnClickListener(view1 -> {
//            confirm("");
//            dismissDialog();
//        });
    }

    public abstract void confirm(String type);

    public void showDialog() {
        dialog.show();
    }

    public void dismissDialog() {
        if (dialog != null) {
            if (dialog.isShowing()) {
                dialog.dismiss();
            }
        }
    }
}
